package com.javaspeak.algorithm.fibonacci.notrecursive;

import static org.junit.Assert.assertEquals;

import java.math.BigInteger;

import org.junit.Test;
import org.junit.internal.TextListener;
import org.junit.runner.JUnitCore;

import com.javaspeak.algorithm.fibonacci.conciserecursive.FibonacciGeneratorTest;

/**
 * @author John Dickerson
 */
public class FibonaciGeneratorNonRecursiveTest {

    @Test
    public void testGetFibonacci(){

        // 1 1 2 3 5 8 13 21 34 ...

        assertEquals( BigInteger.valueOf( 21L ),
                FibonacciGeneratorNonRecursive.getFibonnacci( 8 ) );
    }

    public static void main( String args[] ){

        JUnitCore junitCore = new JUnitCore();
        junitCore.addListener( new TextListener( System.out ) );
        junitCore.run( FibonaciGeneratorNonRecursiveTest.class );
    }
}
